﻿Imports System.IO
Imports Training.Common


Partial Public Class AddNewAnswer
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

    End Sub

    Private Sub InsertAnswer()
        If InsertNewAnswer(tbAnswer.Text) = 0 Then
            lblMsg.Text = "Answer was inserted. You may add another."
            tbAnswer.Text = String.Empty
        Else
            lblMsg.Text = "There was an error inserting. Please try again."
        End If
    End Sub

    Private Sub btnAdd_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnAdd.Click
        If Page.IsValid Then
            InsertAnswer()
        End If
    End Sub
End Class